<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>我的订单</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="/order_t/css/style.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="/order_t/js/jquery.min.js"></script>
        <script type="text/javascript" src="/order_t/js/tab.js"></script>
        <script src="/js/common.js"></script>
        <script src="/js/plugins/jrender/jrender.min.js"></script>
        <script>
            $(function () {
                var params = getParams();
                /*  $.ajax({
                      async: false,
                      url:'/orders/user',
                      method:"get",
                      data:{
                          userId:params.userId
                      },
                      success: function (data) {

                          var dataList=[];
                          $.each(data.result,function (index,value) {
                              $.each(value,function (index,value) {
                                  dataList.push(value)
                              })
                          })
                          console.log(dataList);
                          $("#quanbu").renderValues({list:dataList});
                      }
                  })*/
                $.ajax({
                    async: false,
                    url:'/orders/listByStatus',
                    method:"get",
                    data:{userId:params.userId,status:0},
                    success: function (data) {
                        console.log(data);
                        $("#dai").renderValues({list:data},{ getHref:function (item, value) {
                                var href = $(item).attr("href");
                                $(item).attr("href",href+value);
                            }});

                    }
                })

                $("#daifukuan").click(function () {
                    // $.get('/orders/listByStatus',{userId:params.userId,status:0},function (data) {
                    //         $("#dai").renderValues({list:data},{ getHref:function (item, value) {
                    //                 var href = $(item).attr("href");
                    //                 $(item).attr("href",href+value);
                    //             }});
                    // })
                    $.ajax({
                        async: false,
                        url:'/orders/listByStatus',
                        method:"get",
                        data:{userId:params.userId,status:0},
                        success: function (data) {
                            console.log(data);
                            $("#dai").renderValues({list:data},{ getHref:function (item, value) {
                                    var href = $(item).attr("href");
                                    $(item).attr("href",href+value);
                                }});
                        }
                    })
                })
                $("#daishouhuo").click(function () {
                    $.ajax({
                        async: false,
                        url:'/orders/listByStatus',
                        method:"get",
                        data:{userId:params.userId,status:1},
                        success: function (data) {
                            console.log(data);
                            $("#shouhuo").renderValues({list:data});
                        }

                    })
                    $('.querenshouhuo').click(function () {
                        var orderId = $(this).data('id')
                        $.ajax({
                            async: false,
                            url:'/users/changeOrderstatus',
                            method:"put",
                            data:{orderId:orderId,status:2},
                            success: function (data) {
                                window.location.reload()
                            }

                        })
                    })
                })
                $("#wancheng").click(function () {
                    $.ajax({
                        async: false,
                        url:'/orders/listByStatus',
                        method:"get",
                        data:{userId:params.userId,status:2},
                        success: function (data) {
                            console.log(data);
                            $("#yiwancheng").renderValues({list:data});
                        }
                    })
                })
                $("#quxiao").click(function () {
                    $.ajax({
                        async: false,
                        url:'/orders/listByStatus',
                        method:"get",
                        data:{userId:params.userId,status:3},
                        success: function (data) {
                            console.log(data);
                            $("#yiquxiao").renderValues({list:data});
                        }
                    })
                })
            })
        </script>
    </head>
    <body>

    <section class="aui-flexView">
        <header class="aui-navBar aui-navBar-fixed">
            <a href="/mine/profiles.html" class="aui-navBar-item">
                <i class="icon icon-return"></i>
            </a>
            <div class="aui-center">
                <span class="aui-center-title">我的订单</span>
            </div>
            <a href="javascript:;" class="aui-navBar-item">
                <i class="icon icon-sys"></i>
            </a>
        </header>
        <section class="aui-scrollView">
            <div class="aui-tab" data-ydui-tab>
                <ul class="tab-nav">
                   <!-- <li class="tab-nav-item tab-active">
                        <a href="javascript:;">全部</a>
                    </li>-->
                    <li class="tab-nav-item tab-active" id="daifukuan">
                        <a href="javascript:;">待付款</a>
                    </li>
                    <li class="tab-nav-item" id="daishouhuo">
                        <a href="javascript:;">待收货</a>
                    </li>
                    <li class="tab-nav-item" id="wancheng">
                        <a href="javascript:;">已完成</a>
                    </li>
                    <li class="tab-nav-item" id="quxiao">
                        <a href="javascript:;">已取消</a>
                    </li>
                </ul>
                <div class="divHeight"></div>
                <div class="tab-panel">
                  <!--  <div class="tab-panel-item tab-active"  id="quanbu">
                        <div class="tab-item">
                            <a href="javascript:void(0);" class="aui-well-item aui-well-item-clear">
                                <div class="aui-well-item-hd">
                                    <img src="images/icon-logo.png" alt="">
                                </div>
                                <div class="aui-well-item-bd">
                                    <h3>骡窝窝官方自营积分商城</h3>
                                </div>
                                <span class="aui-well-item-fr">已取消</span>
                            </a>
                            <div class="aui-mail-product">
                                <a href="javascript:;" class="aui-mail-product-item">
                                    <div class="aui-mail-product-item-hd">
                                        <img render-src="list.productPic" alt="">
                                    </div>
                                    <div class="aui-mail-product-item-bd">
                                        <p render-html="list.productName"></p>
                                    </div>
                                </a>
                            </div>
                            <a href="javascript:;" class="aui-mail-payment">
                                <p>
                                    共<em render-html="list.count"></em>
                                    件商品 实付款: ￥<i render-html="list.productPrice"></i>
                                </p>
                            </a>
                            <div class="aui-mail-button">
                                <a href="javascript:;">再次购买</a>
                                <a href="javascript:;" class="aui-df-color">评价晒单</a>
                                <a href="javascript:;" class="aui-df-color">查看发票</a>
                            </div>
                        </div>
                        <div class="divHeight"></div>
                        <div class="tab-item">
                            <a href="javascript:void(0);" class="aui-well-item aui-well-item-clear">
                                <div class="aui-well-item-hd">
                                    <img src="images/icon-logo.png" alt="">
                                </div>
                                <div class="aui-well-item-bd">
                                    <h3>自营Apple产品专营店</h3>
                                </div>
                                <span class="aui-well-item-fr">已取消</span>
                            </a>
                            <div class="aui-mail-product">
                                <a href="javascript:;" class="aui-mail-product-item">
                                    <div class="aui-mail-product-item-hd">
                                        <img src="images/pd-002.png" alt="">
                                    </div>
                                    <div class="aui-mail-product-item-bd">
                                        <p>Apple 苹果 iPhone8 Plus 4G手机 深空灰 移动联通版64G裸机Apple 苹果 iPhone8 Plus 4G手机 深空灰 移动联通版64G裸机</p>
                                    </div>
                                </a>
                            </div>
                            <a href="javascript:;" class="aui-mail-payment">
                                <p>
                                    共<em>1</em>
                                    件商品 实付款: ￥<i>6899.00</i>
                                </p>
                            </a>
                            <div class="aui-mail-button">
                                <a href="javascript:;">再次购买</a>
                            </div>
                        </div>
                        <div class="divHeight"></div>
                        <div class="tab-item">
                            <a href="javascript:void(0);" class="aui-well-item aui-well-item-clear">
                                <div class="aui-well-item-hd">
                                    <img src="images/icon-logo.png" alt="">
                                </div>
                                <div class="aui-well-item-bd">
                                    <h3>自营Apple产品专营店</h3>
                                </div>
                                <span class="aui-well-item-fr">已取消</span>
                            </a>
                            <div class="aui-mail-product">
                                <a href="javascript:;" class="aui-mail-product-item">
                                    <div class="aui-mail-product-item-hd">
                                        <img src="images/pd-003.png" alt="">
                                    </div>
                                    <div class="aui-mail-product-item-bd">
                                        <p>Apple 苹果 iPhone8 Plus 4G手机 深空灰 移动联通版64G裸机Apple 苹果 iPhone8 Plus 4G手机 深空灰 移动联通版64G裸机</p>
                                    </div>
                                </a>
                            </div>
                            <a href="javascript:;" class="aui-mail-payment">
                                <p>
                                    共<em>1</em>
                                    件商品 实付款: ￥<i>6899.00</i>
                                </p>
                            </a>
                            <div class="aui-mail-button">
                                <a href="javascript:;">再次购买</a>
                                <a href="javascript:;">再次购买</a>
                            </div>
                        </div>
                    </div>-->
                    <div class="tab-panel-item tab-active" id="dai" >
                        <div class="tab-item" render-loop="list">
                            <div>
                            <a href="javascript:void(0);" class="aui-well-item aui-well-item-clear">
                                <div class="aui-well-item-hd">
                                    <img src="/img/order/391d2805-578c-42d9-9aa4-e0dbe689d6eb.jpg" alt="">
                                </div>
                                <div class="aui-well-item-bd">
                                    <h3>骡窝窝官方自营积分商城</h3>
                                </div>
                                <span class="aui-well-wait">等待付款</span>
                            </a>
                            <div class="aui-mail-product">
                                <a href="javascript:;" class="aui-mail-product-item">
                                    <div class="aui-mail-product-item-hd">
                                        <img render-src="list.product_pic" alt="" id="pro">
                                    </div>
                                    <div class="aui-mail-product-item-bd">
                                        <p render-html="list.product_name"></p>
                                    </div>
                                </a>
                            </div>
                            <a href="javascript:;" class="aui-mail-payment">
                                <p>
                                    共<em render-html="list.count"></em>
                                    件商品 实付款: ￥<i render-html="list.cost"></i>
                                </p>
                            </a>
                            <div class="aui-mail-button">
                                <a href="/mine/shop/zhifu.html?id=" render-key="list.id" render-fun="getHref">去支付</a>
                            </div>
                            </div>
                        </div>
                    </div>


                    <div class="tab-panel-item" id="shouhuo">
                        <div class="tab-item"  render-loop="list">
                            <div>
                            <a href="javascript:void(0);" class="aui-well-item aui-well-item-clear">
                                <div class="aui-well-item-hd">
                                    <img src="/img/order/391d2805-578c-42d9-9aa4-e0dbe689d6eb.jpg" alt="">
                                </div>
                                <div class="aui-well-item-bd">
                                    <h3>骡窝窝官方自营积分商城</h3>
                                </div>
                                <span class="aui-well-wait">等待收货</span>
                            </a>
                            <div class="aui-mail-product">
                                <a href="javascript:;" class="aui-mail-product-item">
                                    <div class="aui-mail-product-item-hd">
                                        <img render-src="list.product_pic" alt="">
                                    </div>
                                    <div class="aui-mail-product-item-bd">
                                        <p render-html="list.product_name"></p>
                                    </div>
                                </a>
                            </div>
                            <a href="javascript:;" class="aui-mail-payment">
                                <p>
                                    共<em render-html="list.count"></em>
                                    件商品 实付款: ￥<i render-html="list.cost"></i>
                                </p>
                            </a>
                            <div class="aui-mail-button">
                                <a href="javascript:;" class="querenshouhuo" render-attr="data-id=list.id">确认收货</a>
                                <a href="javascript:;" class="aui-df-color">再次购买</a>
                                <a href="javascript:;" class="aui-df-color">查看物流</a>
                            </div>
                            </div>
                        </div  >
                    </div>


                    <div class="tab-panel-item" id="yiwancheng">
                        <div class="tab-item" render-loop="list">
                            <div>
                            <a href="javascript:void(0);" class="aui-well-item aui-well-item-clear">
                                <div class="aui-well-item-hd">
                                    <img src="/img/order/391d2805-578c-42d9-9aa4-e0dbe689d6eb.jpg" alt="">
                                </div>
                                <div class="aui-well-item-bd">
                                    <h3>骡窝窝官方自营积分商城</h3>
                                </div>
                                <span class="aui-well-item-fr"></span>
                            </a>
                            <div class="aui-mail-product">
                                <a href="javascript:;" class="aui-mail-product-item">
                                    <div class="aui-mail-product-item-hd">
                                        <img render-src="list.product_pic" alt="">
                                    </div>
                                    <div class="aui-mail-product-item-bd">
                                        <p render-html="list.product_name">盼盼 酸梅汤 酸梅汁风味饮料 250ml*24盒 整箱 果汁饮料</p>
                                    </div>
                                </a>
                            </div>
                            <a href="javascript:;" class="aui-mail-payment">
                                <p>
                                    共<em render-html="list.count">1</em>
                                    件商品 实付款: ￥<i render-html="list.cost">21.90</i>
                                </p>
                            </a>
                            <div class="aui-mail-button">
                                <a href="javascript:;">再次购买</a>
                                <a href="javascript:;" class="aui-df-color">评价晒单</a>
                                <a href="javascript:;" class="aui-df-color">查看发票</a>
                            </div>
                        </div>
                        </div>
                    </div>


                    <div class="tab-panel-item" id="yiquxiao">
                        <div class="tab-item" render-loop="list">
                            <div>
                            <a href="javascript:void(0);" class="aui-well-item aui-well-item-clear">
                                <div class="aui-well-item-hd">
                                    <img src="/img/order/391d2805-578c-42d9-9aa4-e0dbe689d6eb.jpg" alt="">
                                </div>
                                <div class="aui-well-item-bd">
                                    <h3>骡窝窝官方自营积分商城</h3>
                                </div>
                                <span class="aui-well-item-fr">已取消</span>
                            </a>
                            <div class="aui-mail-product">
                                <a href="javascript:;" class="aui-mail-product-item">
                                    <div class="aui-mail-product-item-hd">
                                        <img render-src="list.product_pic" alt="">
                                    </div>
                                    <div class="aui-mail-product-item-bd">
                                        <p render-html="list.product_name">OPPO R15 全面屏双摄拍照手机 4G+128G 雪盈白 全网通 移动联通电信4G 双卡双待手机</p>
                                    </div>
                                </a>
                            </div>
                            <a href="javascript:;" class="aui-mail-payment">
                                <p>
                                    共<em render-html="list.count">1</em>
                                    件商品 实付款: ￥<i render-html="list.cost">2499.00</i>
                                </p>
                            </a>
                            <div class="aui-mail-button">
                                <a href="javascript:;">再次购买</a>
                                <a href="javascript:;" class="aui-df-color">评价晒单</a>
                                <a href="javascript:;" class="aui-df-color">查看发票</a>
                            </div>
                        </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </section>
    </body>
</html>
